package cn.bdqn.web.controller.dev;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.bdqn.entity.DevUser;
import cn.bdqn.service.DevUserService;


@Controller
@RequestMapping("/devUser")
public class DevUserController {

	@Autowired
	private DevUserService devUserService;
	
	@RequestMapping("/disLogin")
	public String disLogin(){
		return "devLogin";
	}
	
	
	@RequestMapping("/login")
	public String login(HttpServletRequest request,HttpSession session,
						@RequestParam(value="devCode",required=false)String username,
						@RequestParam(value="devPassword",required=false)String password){
		
		SecurityUtils.getSubject().login(new UsernamePasswordToken(username,password));
		
		
		
		
		return "redirect:/devApp/disMain";
		
		
	}
	
}
